from django.conf.urls import url
from django.urls import path, include, re_path
from rest_framework.routers import DefaultRouter

from test02.settings import MEDIA_ROOT
from .views import ProvincialView, UserView, AreaView, ImageView

router = DefaultRouter()
router.register('user', UserView)
router.register('addreInfo', ProvincialView)
router.register('areamanage', AreaView)
router.register('image', ImageView)
from django.conf import settings
from django.views.static import serve
urlpatterns = [
    path('', include(router.urls)),
    # #获取所有数据和添加数据
    # path('addreInfo/', CityView.as_view({'get': 'list','post':'create'})),
    # #'get': 'retrieve'得到某一条数据----'delete': 'destroy'删除某一条数据------,'patch':
    # # 'partial_update'-----更新某一字段,'put':'update'----需要传入所有字段才可根性
    # path('addreInfo/<int:pk>', CityView.as_view({'get': 'retrieve','delete': 'destroy','patch': 'partial_update','put':'update'}))
]

